<%@page import="support.*, java.util.*" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Verification</title>
</head>
<body>
    <!-- Book keeping for Specialization -->
    <%
    // receive specializaion and put into session
      String specialization = request.getParameter("specialization");
      session.setAttribute("specialization", specialization);
            
      // bandaid for confirmation.jsp
      session.setAttribute("applied", "true");
    %>
    
    Please Verify Information: <br>
    
    <%
    // print name
    out.print("Name:  " + session.getAttribute("first") + " " + session.getAttribute("middle") + " " + session.getAttribute("last") + "<br>" );
    // print address
    out.print("From:  " +  session.getAttribute("citizen") + "<br>" + 
              "Living in:  " + session.getAttribute("residence") + "<br>" +
              "Address:  " + session.getAttribute("address") + " " + 
                  session.getAttribute("city"));
    // prints state if us residence
    if(session.getAttribute("residence").equals("United States")){
        out.print(", " + session.getAttribute("state"));
    }
    out.print(" " + session.getAttribute("zip")); %> <br>
    Telephone: 
    <%
    if(!session.getAttribute("residence").equals("United States")){
        out.print(session.getAttribute("telecode") + " ");
    }
    out.print(session.getAttribute("area") + " " + session.getAttribute("number")); %> <br> <br>
    
    <%
      // add the current Degree hashed set to the vector of degrees
      LinkedHashSet degrees = (LinkedHashSet)session.getAttribute("degrees");
    
      // create iterator to go through all the degrees
      Iterator it = degrees.iterator();
      while(it.hasNext()){
          out.print(it.next());
          out.print("<br>");
      }
      // print specialization
      out.print("<br> Specialization: " + session.getAttribute("specialization"));
    %>
 
    <!--  Submit application button -->
    <form method="get" action="confirmation.jsp?">
        <input type="submit" name="Insert" value="Submit Application">
    </form>
    
    <!--  Cancel button -->
    <form action="Cancellation.jsp">
        <input type="submit" value="Cancel">
    </form>
    
</body>
</html>